//
//  RecordListSettingViewCotroller.m
//  MoneyLog
//
//  Created by wicresoft on 6/16/11.
//  Copyright 2011 wicresoft. All rights reserved.
//

#import "RecordListSettingViewCotroller.h"


@implementation RecordListSettingViewCotroller
@synthesize searchType;
@synthesize displayType;
@synthesize searchTypeSegmented,displayTypeSegmented;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [searchTypeSegmented release];
    [displayTypeSegmented release];
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    searchTypeSegmented.tag =100;
    displayTypeSegmented.tag = 101;
    
    [searchTypeSegmented setSelectedSegmentIndex:searchType];
    [displayTypeSegmented setSelectedSegmentIndex:displayType];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(IBAction)segmentedAction:(id)sender
{
    UISegmentedControl *control = (UISegmentedControl *) sender;
    if (control.tag== 100) {
        self.searchType = control.selectedSegmentIndex;
    }
    else if(control.tag == 101)
    {
        self.displayType = control.selectedSegmentIndex;
    }
}

@end
